<!--
/**
 * moOde audio player (C) 2014 Tim Curtis
 * http://moodeaudio.org
 *
 * (C) 2021 @bitlab (@bitkeeper Git)
 *
 * This Program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 *
 * This Program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * 汉化：Androidnews
 */
-->
<div id="container">
<div class="container">
	<h1>$_heading</h1>

	<!-- BACKUP -->

	<form class="form-horizontal" action="" method="post" id="backup" enctype="multipart/form-data" $_backup_hidden>
		<legend>选项</legend>

		<p class="sub-legend">
			指定系统的哪些部分将包含在备份zip文件中。可以选择添加一个脚本文件，用于在恢复过程中执行自定义操作。它在moOde启动期间运行，作为恢复系统配置的一部分。
			请注意，WiFi和AP模式密码将包含在备份的配置和首选项部分。
		</p>

		<div class="control-group">
			<label class="control-label">添加脚本</label>
			<div class="controls">
				<label for="backup-scriptfile" id="choose-backup-scriptfile" class="btn btn-primary btn-medium config-btn">选择</label>
				<input type="file" id="backup-scriptfile" accept=".sh,.py" name="backup_scriptfile" style="display:none" onchange="$('#btn-import-scriptfile').click();">
				<button id="btn-import-scriptfile" class="btn btn-medium btn-primary btn-submit" type="submit" name="import_scriptfile" value="1"  style="display:none"></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-backup-scriptfile" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
				<span class="config-help-static">
					$_imported_scriptfile
				</span>
				<span id="info-backup-scriptfile" class="config-help-info">
					添加一个在恢复过程中执行自定义操作的脚本文件。
				</span>
			</div>

			<label class="control-label">配置和首选项</label>
			<div class="controls">
				$_togglebtn_backup_system
				<span id="info-backup-system" class="config-help-info">
					备份系统配置和首选项，包括背景图像（如果有的话）。
				</span>
			</div>

			<label class="control-label">CamillaDSP</label>
			<div class="controls">
				$_togglebtn_backup_camilladsp
				<span id="info-backup-camilladsp" class="config-help-info">
					备份CamillaDSP管道配置和IR文件。
				</span>
			</div>

			<label class="control-label">播放列表</label>
			<div class="controls">
				$_togglebtn_backup_playlists
				<span id="info-backup-playlists" class="config-help-info">
					备份播放列表。
				</span>
			</div>

			<label class="control-label">保存的搜索</label>
			<div class="controls">
				$_togglebtn_backup_searches
				<span id="info-backup-searches" class="config-help-info">
					备份保存的搜索。
				</span>
			</div>

			<label class="control-label">moOde电台</label>
			<div class="controls">
				$_togglebtn_backup_radiostations_moode
				<span id="info-backup-radiostations-moode" class="config-help-info">
					moOde提供的电台。
				</span>
			</div>

			<label class="control-label">其他电台</label>
			<div class="controls">
				$_togglebtn_backup_radiostations_other
				<span id="info-backup-radiostations-other" class="config-help-info">
					备份用户添加的电台。
				</span>
			</div>

			<!--
			label class="control-label" for="wlan0pwd">WiFi password</label>
			<div class="controls">
				<input class="config-input-large" type="password" pattern=".{8,64}" id="backup-wlan0pwd" name="backup_wlan0pwd" value="$_wlan0pwd" >
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-backup-wlan0pwd" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
				<a class="show-hide-password" href="#notarget" data-id="backup_wlan0pwd"><i class="fa-regular fa-sharp fa-eye"></i></a>
				<span id="info-backup-wlan0pwd" class="config-help-info">
					Length 8-63 chars. The password will be converted to a pre-shared key (PSK) after saving.
				</span>
			</div>
			-->

			<div class="controls">
				<button id="backup-create" class="btn btn-medium btn-primary config-btn" type="submit" name="backup_create" form="backup" value="1">创建备份</button>
				<span class="config-help-static">
					备份zip文件将被下载到默认的下载文件夹中。
				</span>
			</div>
		</div>
	</form>

	<!-- RESTORE -->

	<form class="form-horizontal" action="" method="post" id="restore"  enctype="multipart/form-data" $_restore_hidden>
		<legend>选项</legend>

		<p class="sub-legend">
			指定将恢复系统的哪些部分。
			ON/OFF选项按钮是根据所选备份zip文件的内容自动设置的。如果将脚本文件添加到备份中，它将在moOde启动期间运行，作为恢复Config和Prefs的一部分。
		</p>

		<div class="control-group">
			<label class="control-label">配置和首选项</label>
			<div class="controls">
				$_togglebtn_restore_system
				<span id="info-restore-system" class="config-help-info">
					恢复系统配置和首选项，包括背景图像（如果有的话）。
				</span>
			</div>

			<label class="control-label">CamillaDSP</label>
			<div class="controls">
				$_togglebtn_restore_camilladsp
				<span id="info-restore-camilladsp" class="config-help-info">
					恢复CamillaDSP管道配置和IR文件。
				</span>
			</div>
			<div class="controls">
				$_togglebtn_restore_camilladsp_with_replace
				<span class="config-help-static">
					从备份中恢复之前，请先删除现有配置和IR文件。
				</span>
			</div>

			<label class="control-label">播放列表</label>
			<div class="controls">
				$_togglebtn_restore_playlists
				<span id="info-restore-playlists" class="config-help-info">
					恢复播放列表。
				</span>
			</div>

			<label class="control-label">保存搜索</label>
			<div class="controls">
				$_togglebtn_restore_searches
				<span id="info-restore-searches" class="config-help-info">
					恢复保存的搜索。
				</span>
			</div>

			<label class="control-label">moOde电台</label>
			<div class="controls">
				$_togglebtn_restore_radiostations_moode
				<span id="info-restore-radiostations-moode" class="config-help-info">
					恢复moOde电台。
				</span>
			</div>

			<label class="control-label">其他电台</label>
			<div class="controls">
				$_togglebtn_restore_radiostations_other
				<span id="info-restore-radiostations-other" class="config-help-info">
					恢复用户添加的电台。
				</span>
			</div>

			<label class="control-label">备份文件</label>
			<div class="controls">
				<label for="restore-backupfile" id="choose-restore-backupfile" class="btn btn-primary btn-medium config-btn">选择</label>
				<input type="file" id="restore-backupfile" accept=".zip" name="restore_backupfile" style="display:none" onchange="$('#btn-import-backupfile').click();">
				<button id="btn-import-backupfile" class="btn btn-medium btn-primary btn-submit" type="submit" name="import_backupfile" value="1"  style="display:none"/>
				<button class="btn btn-medium btn-primary btn-submit config-btn" type="submit" name="reset_options" form="restore" value="1">重置</button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-backupfile" href="#notarget"><i class="fa-solid fa-sharp fa-info-circle"></i></a>
				<div class="config-help-static">
					$_imported_backupfile
				</div>
				<span id="info-backupfile" class="config-help-info">
					选择: 选择并上载将用于恢复过程的备份zip文件。<br>
					重置: 从临时目录中清除上传的文件，并将选项按钮重置为“否”。
				</span>
			</div>

			<div class="controls">
				<button class="btn btn-medium btn-primary btn-submit config-btn" type="submit" name="restore_start" form="restore" value="1">恢复系统</button>
				<span class="config-help-static">
					如果Config和Prefs是恢复的一部分，则需要重新启动。
				</span>
			</div>
		</div>
	</form>
</div>
</div>
